<template>
  <div class="">
    <el-table
      :data="state.user.tableData"
      style="width: 100%"
    >
      <el-table-column
        prop="date"
        label="日期"
        width="180"
      />
      <el-table-column
        prop="name"
        label="姓名"
        width="180"
      />
      <el-table-column
        prop="address"
        label="地址"
      />
      <el-table-column
        fixed="right"
        label="操作"
        width="100"
      >
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleClick(scope)">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script type="text/ecmascript-6">
import { state } from '@/views/operationReport/state';
export default {
  data() {
    return {
      state
    };
  },
  methods: {
    handleClick(scope) {
      const { $index } = scope;
      state.user.tableData[$index].name = '炒青菜';
    }
  }
};
</script>

<style lang="less" scoped>
</style>
